<%-- 
    Document   : admin
    Created on : May 22, 2011, 6:59:02 PM
    Author     : gerardino
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="/Common/header.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd"><%

   Inventory i = (Inventory)request.getAttribute("i");
   String messages = Methods.messageListToHtml((List<String>)request.getAttribute(Const.MESSAGE));
%>
<script type="text/javascript" src="/scripts/Inventory/admin.js">
</script>
<script type="text/javascript">
    $(function(){
       
       //$(".iLabel<%= i.getId().getId() %>").html('<%= i.getName() %>');
       loadUsers(<%= i.getId().getId() %>);
       
       
       var messages = '<%= messages %>';
       if (messages){
            showInformation(messages, 5000);
       }
    });
</script>
<h2>Administraci&oacute;n de opciones</h2>
<form action="/Inventory/admin" method="POST" id="adminFm">
    <input type="hidden" name="iid" value="<%= i.getId().getId() %>">
<table class="form">
    <tr>
        <th>Nombre</th>
        <td><input type="text" maxlength="40" size="40" name="iName" value="<%= i.getName() %>"></td>
    </tr>
    <tr>
        <th>Propietario</th>
        <td><%= i.getOwner() %></td>
    </tr>
    <tr>
        <th>Usuarios con acceso</th>
        <td>
            <p id="usersContent">
            </p>
        </td>
    </tr>
    <tr>
        <th>&nbsp;</th>
        <td>Ingrese aqu&iacute; los correos de usuarios a dar acceso <br>
            separados por ; <br>
            <textarea name="newUsers" rows="4" cols="40"></textarea>
        </td>
    </tr>
</table>
<br>
<p>
    <input type="submit" value="Guardar cambios">
</p>
</form>
